package com.cmcc.aregister.ui.dialog;

import android.content.Context;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.cmcc.aregister.R;
import com.cmcc.aregister.cs.model.Department;

public class DepartmentInfoDialog extends MyDialog {
	private Button confirm;

	public DepartmentInfoDialog(Context context, Department department) {
		super(context);
		setContentView(R.layout.dialog_subject_info);

		((TextView) findViewById(R.id.dialog_title))
				.setText(department.dep_name);
		((TextView) findViewById(R.id.dialog_unit_name))
				.setText(department.unit_name);
		((TextView) findViewById(R.id.dialog_dep_info))
				.setText(department.dep_intro);
		((TextView) findViewById(R.id.dialog_dep_info))
				.setMovementMethod(ScrollingMovementMethod.getInstance());
		confirm = (Button) findViewById(R.id.dialog_confirm_btn);

		confirm.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});
	}

	public void setCancelClickListener(View.OnClickListener onClickListener) {
		confirm.setOnClickListener(onClickListener);
	}
}
